package file.day9_18.day03.homework;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Test03 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        File file = new File(".");
        File[] files = file.listFiles(f->f.isFile()&&f.getName().contains(".obj"));
        for (File file1 : files){
            String name = file1.getName();
            FileInputStream fis = new FileInputStream(name);
            ObjectInputStream ois = new ObjectInputStream(fis);

            User user = (User) ois.readObject();

            System.out.println(user.toString());
        }
    }
}
